home *** CD-ROM | disk | FTP | other *** search
/ AMIGA-CD 2 / Amiga-CD - Volume 2.iso / ungepackte_daten / 1993 / 10 / 02 / tips & tricks / all.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1995-06-01  |  764 b   |  43 lines

  1. /* Ausführung eines CLI-Befehls auf
  2.    eine Gruppe von Dateien
  3.  */
  4.  
  5. address command
  6.  
  7. parse arg Pattern Befehl
  8.  
  9. Dir = "#?"
  10. Laenge = LENGTH(Pattern)
  11. RevPattern = REVERSE(Pattern)
  12. Index=VERIFY(RevPattern,":/","Match")
  13.  
  14. if Index ~= 0 then
  15.   do
  16.     Dir = REVERSE(RIGHT(RevPattern,
  17.                     Laenge-Index+1))
  18.     Files = REVERSE(LEFT(RevPattern,
  19.                     Index-1))
  20.   end
  21. else
  22.   Files = Pattern
  23.  
  24. "search from" Dir "file" Files
  25.    ">RAM:all.tmp"
  26.  
  27. ok=Open(Namen,"ram:all.tmp","read")
  28. if ok then
  29.   do
  30.     Name = READLN(Namen)
  31.     do while ~(EOF(Namen))
  32.       say Befehl Name
  33.       Befehl Name
  34.       Name = READLN(Namen)
  35.     end
  36.   ok=CLOSE(Namen)
  37.   if ok then
  38.     "delete RAM:all.tmp"
  39. else
  40.   say "Fehler: Konnte Datei nicht
  41.                 erzeugen"
  42. end
  43.